import os
import re

folder_path = 'F:\学习\数据集\实验室数据集操作版\性诱\性诱网站下载221026\标注'  # 替换为实际的文件夹路径

for file_name in os.listdir(folder_path):
    if file_name.endswith('.xml'):
        file_path = os.path.join(folder_path, file_name)
        with open(file_path, 'r', encoding='utf-8') as f:
            content = f.read()

        new_content = re.sub(r'jpeg', 'jpg', content)

        with open(file_path, 'w', encoding='utf-8') as f:
            f.write(new_content)
print("完成")